<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>校园宿舍管理系统 - 登录</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background: linear-gradient(to right, #a8e6cf, #d3f0e8);            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        .login-container {
            max-width: 450px;
            margin: 120px auto;
            padding: 30px;
            background: #ffffffee;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            backdrop-filter: blur(10px);
        }
        .form-control:focus {
            border-color: #26c6da;
            box-shadow: 0 0 0 0.2rem rgba(38, 198, 218, 0.25);
        }
        .btn-primary {
            background-color: #26a69a;
            border-color: #26a69a;
            transition: background-color 0.3s ease;
        }
        .btn-primary:hover {
            background-color: #208c82;
            border-color: #1e7e77;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="login-container">
        <h2 class="text-center mb-4">校园宿舍管理系统</h2>
        <div th:if="${message}" class="alert alert-info text-center" th:text="${message}"></div>
        <form th:action="@{/user/login}" method="post">
            <div class="mb-3">
                <label for="account" class="form-label">账号/邮箱/手机号</label>
                <input type="text" class="form-control" id="account" name="account" required autofocus>
            </div>
            <div class="mb-3">
                <label for="password" class="form-label">密码</label>
                <input type="password" class="form-control" id="password" name="password" required>
            </div>
            <button type="submit" class="btn btn-primary w-100">登录</button>
        </form>
        <div class="mt-3 text-center">
            <a th:href="@{/user/register}" class="text-decoration-none">注册新账号</a>
        </div>
    </div>
</div>
</body>
</html>